<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class ModifyProjectHistoryUserId extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        if (!Schema::hasColumn('project_history', 'mark')) {
            Schema::table('project_history', function (Blueprint $table) {
                $table->unsignedInteger('user_id')->default(0)->after('status')->comment('操作人ID');
            });
        }
        if (!Schema::hasColumn('task_history', 'mark')) {
            Schema::table('task_history', function (Blueprint $table) {
                $table->unsignedInteger('user_id')->default(0)->after('status')->comment('操作人ID');
            });
        }
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        //
    }
}
